<?php

/*
 * CONTROLE FINANÇAS PESSOAIS
 *
 * Controle dos lançamentos de contas
 *
 *	Histórico:
 *	- v.15/05/2012 - Edgard Fantini Júnior -efantinij@gmail.com
 *		- versão inicial gerada pelo gerarAplicacao.sh
 *
 * FRAMWORK: edframe - Copyleft (cc) 2012 EDMAR Sistemas
 *
*/


class Vopera extends ClassGeral
{
	var $form ;

		/*
		 * metodo get_busca()
		 * apresenta os inputs para busca do objeto
		 */
		function get_busca()
		{
			$this->form[0]  = "<TABLE class='entrada'>" ;
			$this->form[0] .= "<CAPTION> CONSULTA:</CAPTION>" ;
			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD width='25%'>Hist&oacute;rico da opera&ccedil;&atilde;o:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= "<INPUT tipo='STR' label='Hist&oacute;rico da compra' ";
			$this->form[0] .= "size='20' maxlength='20' name='historico' />" ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;
			$this->form[0] .= "</TABLE>" ;

			$_Botoes = new MGeraBotoes ;
			$this->form[2] = $_Botoes->gerar("BUSCAR|acao|G|1#NOVA|acao|R|2#FINANCAS|acao|R|6") ;
	}




	function get_edit()
	{
		$this->form[0] = "" ;

		if (!empty($this->sel))
		{
			$sit = retornaStatus($this->sel[0]->ativo) ;
			$this->form['ident'] = $this->sel[0]->op ;

			$this->form[0]  = "<TABLE class='entrada'>" ;
			$this->form[0] .= "<CAPTION>EDI&Ccedil;&Atilde;O DE COMPRAS:</CAPTION>" ;
			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>op = ".$this->sel[0]->op ."</TD>" ;
			$this->form[0] .= "<INPUT type='hidden' name='op_0' value='".$this->sel[0]->op."' />";
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD width='20%'>Data Compra:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= formatDataPort($this->sel[0]->datcompr) ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>Historico</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= $this->sel[0]->historico ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>T&iacute;tulo</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= $this->sel[0]->objFormpag ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>Parcela:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= $this->sel[0]->parcerest ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>M&ecirc;s Vencimento:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= $this->sel[0]->objNomeMes ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>Valor:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= "<input size='10' maxlength='10' name='valor_0' label='Valor'";
			$this->form[0] .= "value='".$this->sel[0]->valor."' />" ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;


			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>Se opera&ccedil;&atilde;o de Cr&eacute;dito ou D&eacute;bito</TD>" ;
			$this->form[0] .= "<TD colspan='2'>" ;
			$this->form[0] .= "<INPUT title='tipo' size='1' maxlength='1' name='tipo' label='Tipo'" ;
			$this->form[0] .= "onkeyup='mascara(this,up);' value='".$this->sel[0]->tipo."'/>" ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "<TR>" ;
			$this->form[0] .= "<TD>SITUA&Ccedil;&Atilde;O:</TD>" ;
			$this->form[0] .= "<TD>" ;
			$this->form[0] .= "<INPUT type='radio' name='situacao' id='sitA' value='A' ".$sit['A']." />Ativo" ;
			$this->form[0] .= "<INPUT type='radio' name='situacao' id='sitI' value='I' ".$sit['I']." />Inativo" ;
			$this->form[0] .= "</TD>" ;
			$this->form[0] .= "</TR>" ;

			$this->form[0] .= "</TABLE>" ;
		}
		else
			$this->form['ident'] = '' ;

		$this->form[1] = "<TABLE class='entrada'>" ;
		$this->form[1] .= "<CAPTION>NOVA OPERA&Ccedil;&Atilde;O:</CAPTION>" ;
TTransaction::log('123 edit');
		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD width='20%'>Data Compra</TD>" ;
		$this->form[1] .= "<TD>" ;

		$this->form[1] .= "<INPUT title='Data Compra' maxlength='10' label='Data da nova Compra' ";
		$this->form[1] .= "onclick='popdate( ";
		$this->form[1] .= "&quot;document.formu.datcompr_New&quot;, ";
		$this->form[1] .= "&quot;pop_New&quot;, ";
		$this->form[1] .= "&quot;50&quot;, ";
		$this->form[1] .= "document.formu.datcompr_New.value ";
		$this->form[1] .= ")'  ";
		$this->form[1] .= "name='datcompr_New' onkeyup='mascara(this,data);' size='8' />" ;
		$this->form[1] .= "<span id='pop_New' style='position:absolute'></span>" ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;

		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD >Hist&oacute;rico</TD>" ;
		$this->form[1] .= "<TD>" ;
		$this->form[1] .= "<INPUT size='40' maxlength='100' name='historico_New' label='Hist&oacute;rico da nova Compra'/>" ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;

		$tit = new titulo ;
		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD>T&iacute;tulo</TD>" ;
		$this->form[1] .= "<TD>" ;
		$this->form[1] .= $tit->optTitulo ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;

		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD>M&ecirc;s Vencimento</TD>" ;
		$this->form[1] .= "<TD>" ;
		$this->form[1] .= "<input maxlength='7' name='mesref_New' label='M&ecirc;s da nova Compra' " ;
		$this->form[1] .= "onkeypress='mascara(this,mesref)' size='6'  />" ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;

		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD>Valor Total</TD>" ;
		$this->form[1] .= "<TD>" ;
		$this->form[1] .= "<input size='10' maxlength='10' name='valor_New' label='Valor da nova Compra' ";
		$this->form[1] .= "onkeypress='mascara(this,soFinanceiro)'/>" ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;

		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD>tipo</TD>" ;
		$this->form[1] .= "<TD colspan='2'>" ;
		$this->form[1] .= "<INPUT title='tipo' size='1' maxlength='1' name='tipo' " ;
		$this->form[1] .= "label='Tipo' onkeyup='mascara(this,up);' />" ;
		$this->form[1] .= "</TD>" ;
		$this->form[1] .= "</TR>" ;


		$this->form[1] .= "</TABLE>" ;

		$this->form[1] .= "<TABLE class='entrada'>" ;
		$this->form[1] .= "<CAPTION>Crit&eacute;rio para inclus&atilde;o desta Compra:</CAPTION>" ;
		$this->form[1] .= "<TR>" ;
		$this->form[1] .= "<TD>O VALOR TOTAL DESTA COMPRA SER&Aacute; DIVIDIDO EM: " ;
		$this->form[1] .= "<input size='2' maxlength='2' name='repetir' value='0' ";
		$this->form[1] .= "onkeypress='mascara(this,soNumeros)' />" ;
		$this->form[1] .= " PARCELAS</TD>" ;
		$this->form[1] .= "</TR>" ;
		$this->form[1] .= "</TABLE>" ;


		$_Botoes = new MGeraBotoes ;
		$this->form[2] = $_Botoes->gerar("GRAVAR|acao|G|3#Retornar|acao|R|5#FINANCAS|acao|R|6") ;
	}


}
